package com.ubb.damate.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/** The primary key class for the project database table. */
@Embeddable
public class ProjectPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long	serialVersionUID	= 1L;

	@Column(name = "ProjectName", unique = false, nullable = false, length = 255)
	private String				projectName;

	@Column(name = "WorkspaceId", unique = false, nullable = false)
	private int					workspaceId;

	public ProjectPK() {
	}

	public String getProjectName() {
		return this.projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public int getWorkspaceId() {
		return this.workspaceId;
	}

	public void setWorkspaceId(int workspaceId) {
		this.workspaceId = workspaceId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ProjectPK)) {
			return false;
		}
		ProjectPK castOther = (ProjectPK) other;
		return this.projectName.equals(castOther.projectName) && (this.workspaceId == castOther.workspaceId);

	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.projectName.hashCode();
		hash = hash * prime + this.workspaceId;

		return hash;
	}
}